[IA64] Fix I&D cache incoherency after vcpu migration
authorawilliam@xenbuild2.aw <awilliam@xenbuild2.aw>
Thu, 15 Feb 2007 17:25:33 +0000 (10:25 -0700)
committerawilliam@xenbuild2.aw <awilliam@xenbuild2.aw>
Thu, 15 Feb 2007 17:25:33 +0000 (10:25 -0700)
commit94e4f05d73639bd2045b996c09362562f386c2dc
treedd13a991c7c7a12c7fedd8545c473e69c0489c46
parent96baa92231e89c717ba369f00441e2373ab821f7
[IA64] Fix I&D cache incoherency after vcpu migration

Windows on HVM ocasionally crashes with BSOD especially on boot time.
I finally found out the cause is PAL_CACHE_FLUSH(cache_type=4).
The cache_type means an argument of PAL_CACHE_FLUSH and cache_type=4
makes local instruction caches coherent with the data caches.
See SDM vol2 11.10.3, PAL_CACHE_FLUSH.
FYI, Linux never uses cache_type=4.

Currently PAL_CACHE_FLUSH is called on only local cpu and caches on the
other cpus are still incoherent.

Attached patch does:
- When cache_type=1,2,3 that means flushing caches on local cpus,
  caches on the other cpus becomes to be flushed also.
  It might be overkill and not efficient. But I think it's permissive
  since these cache_type are seldom used.

- When cache_type=4, the actual PAL call to the other cpus is deferred
  until the vcpu migration occurs or the cpu becomes idle.
  Since Windows uses cache_type=4 quite often and many vcpus on SMP
  environment call PAL_CACHE_FLUSH simultaneously.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
xen/arch/ia64/xen/domain.c
xen/arch/ia64/xen/fw_emul.c
xen/include/asm-ia64/domain.h
xen/include/asm-ia64/linux-xen/asm/pal.h